<template>
    <div class="swiper">
    <el-carousel height='200px' trigger="click" arrow="always" autoplay>
      <el-carousel-item v-for="item in banners" :key="item.image">
          <!-- <h3>{{item.title}}</h3> -->
          <a :href="item.link">
            <img :src="item.image" alt="" width="100%" @load='imageLoad'>
          </a>
      </el-carousel-item>
    </el-carousel>
    </div>
</template>

<script>
export default {
    props:{
        banners:Array
    },
    data () {
        return {
            isImageLoad:false
        }
    },
    methods: {
        imageLoad(){
            //在此处做个节阀只要拿到一个图片就可以算出高度了不用都发送
            if(!this.isImageLoad){
                this.$emit('imageitemLoad')
                this.isImageLoad=true
}
        }
    }
};
</script>

<style lang="less" scoped>
.swiper{
    /* margin-top: 44px; */
    
   
}
.swiperHig{
    height: 150px;

}
.el-carousel__button{
    border-radius: 50%;
}

</style>

